package io.bdmc.modules.bss.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;
import io.bdmc.common.utils.MyPage;
import io.bdmc.modules.bss.entity.DeviceAlarmRealtime;
import io.bdmc.modules.bss.model.DeviceAlarmParam;
import io.bdmc.modules.bss.model.DeviceAlarmRealtimeParam;

/**
 * <p>
 * 设备报警历史记录 服务类
 * </p>
 *
 * @author 黄露
 * @since 2020-09-15
 */
public interface IDeviceAlarmRealtimeService extends IService<DeviceAlarmRealtime> {

    MyPage<DeviceAlarmRealtime> mySelectPage(MyPage<DeviceAlarmRealtime> myPage, DeviceAlarmRealtimeParam param);

    MyPage<DeviceAlarmRealtime> mySelectPagePermitAll(MyPage<DeviceAlarmRealtime> myPage,
            DeviceAlarmRealtimeParam param);

    List<DeviceAlarmRealtime> selectAllLastAlarm(DeviceAlarmRealtimeParam param);

    /**
     * mqtt 查询实时告警
     * 
     * @return
     */
    List<DeviceAlarmRealtime> selectRealtimeAlarmList();

    /**
     * 查询是已存在的报警
     *
     * @param deviceSn      设备sn
     * @param alarmTypeCode 报警代号
     * @return DeviceAlarmRealtime
     */
    DeviceAlarmRealtime getLastOneExistAlarm(String deviceSn, String alarmTypeCode, Integer channel);

}
